prefix=@prefix@
LIBDIR=$(prefix)/lib/unicon
CFLAGS = @CFLAGS@
CFLAGS += -I. -I../include
PROG = uniconcfg uniconctrl

CC=gcc $(CFLAGS)

all: $(PROG)
uniconcfg: 
	$(CC) -lnewt uniconcfg.c -o uniconcfg
uniconctrl:
	$(CC) uniconctrl.c -o uniconctrl
clean:
	rm -f a.out *.bak *.o core *~ $(PROG)

install: all
	mkdir -p $(prefix)/bin $(LIBDIR)/bin
	install -o root -g root -m755 uniconcfg $(LIBDIR)/bin/uniconcfg
	install -o root -g root -m755 uniconctrl $(LIBDIR)/bin/uniconctrl
	ln -sf $(prefix)/lib/unicon/bin/uniconctrl /usr/bin/uniconctrl
	ln -sf $(prefix)/lib/unicon/bin/uniconcfg /usr/bin/uniconcfg

distclean: clean
	rm -f Makefile tags TAGS
